package crm

import (

	"log"
	"app/common"
	"git.oschina.net/zhgk/sqldb"
)

type WorkLogService struct {

}

func (p WorkLogService)QueryWorkLogByPage(start, limit interface{}) (res bool, msg string, total int64, data sqldb.RowMaps) {
	sqldb.UserDefaultDB()
	total, err := sqldb.CountTable(WORK_LOG_TABLE_COUNT_SQL)
	if err != nil {
		return false, err.Error(), 0, nil
	}
	rows, err := sqldb.QueryRowMaps(WORK_LOG_TABLE_SQL + " limit ?  offset ? ", limit, start)
	if err != nil {
		log.Println(err.Error())
		return false, err.Error(), 0, nil
	}
	return true, common.SUCCESS, total, rows
}
